<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<style>
    #commentForm .main-container .short_table_list tbody{min-height: unset!important;}
</style>
<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title"><div class="page-title-con"><span id="flowsetname"></span><div class="move_title"></div><?php include "../public/subturn.php";?></div></div>
    <div class="main-container" style="padding-bottom: 500px!important;">

        <div class="block-generic">
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>申请人信息</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">申请人</label>
                        <div class="layui-input-block">
                            <input type="text" id="flowuser" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">申请部门</label>
                        <div class="layui-input-block">
                            <input type="text" id="flowdept" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>工程信息</span><span onclick="go_to_engin_xiang()" class="colorlan" style="float: right;margin-right: 12px">查看工程概况</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>工程名称</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="enginid" class="layui-input enginid" onclick="openPage('../public/choose_engin.php?dom=enginid&page=hou_gonghui','80%','80%')">
                            <div class="choose_div" id="enginid" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_engin.php?dom=enginid&page=hou_gonghui','80%','80%')"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">工程编号</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_number" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">业务归属</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_gui_unit_name" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">工程管理文件汇编</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_neiname" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">工程负责人</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_gofuer" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">工程负责人联系电话</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_gofutel" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">中标价/合同价(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_shimoney" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">工程结算金额(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_shijiefee" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>



            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>本工程回款资金池信息</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">本工程累计回款金额(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_hougonghuimoney" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">累计回款金额占比(%)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_leihuibi" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">本工程回款累计支付(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_hougongzhimoneyquben" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">本工程回款累计收取(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_hougonghuikoufee" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">本工程预留金额(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_jiedongkoufee" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">本工程回款可用余额(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_gonghui_keyu" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>销项发票信息</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">已开具销项发票金额(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_piaokaifee" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">已开具销项发票占比(%)</label>
                        <div class="layui-input-block">
                            <input type="text" id="engin_leixiaobi" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>本次回款信息</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>款项摘要</label>
                        <div class="layui-input-block">
                            <input type="text" name="zhai" id="zhai" placeholder="请输入" clearable autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>款项类型</label>
                        <div class="layui-input-block">
                            <div id="shougonglei"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>收款对象</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="duier" class="layui-input duier" onclick="openPage('../public/choose_dealcom.php?dom=duier&page=hou_gonghui','80%','80%')">
                            <div class="choose_div" id="duier" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_dealcom.php?dom=duier&page=hou_gonghui','80%','80%')"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>到账金额(元)</label>
                        <div class="layui-input-block">
                            <input type="text" name="money" id="money" placeholder="请输入" autocomplete="off" class="layui-input moneyinput">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">累计工程回款含本次(元)</label>
                        <div class="layui-input-block">
                            <input type="text" id="leimoney" placeholder="自动计算" disabled autocomplete="off" class="layui-input disabled">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">累计回款金额占比含本次(%)</label>
                        <div class="layui-input-block">
                            <input type="text" id="leizhanbi" placeholder="自动计算" disabled autocomplete="off" class="layui-input disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>到账方式</label>
                        <div class="layui-input-block">
                            <div id="incdaotype"></div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>到账账户</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="accid" class="layui-input accid" onclick="openPage('../public/choose_account.php?dom=accid','80%','80%')">
                            <div class="choose_div" id="accid" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_account.php?dom=accid','80%','80%')"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>到账日期</label>
                        <div class="layui-input-block">
                            <input type="text" name="dt" id="dt" readonly placeholder="请选择" clearable  autocomplete="off" class="layui-input bdate_ymd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">本次回款占用销项发票金额(元)</label>
                        <div class="layui-input-block">
                            <input type="text" name="xiaofee" id="xiaofee" placeholder="明细自动合计" readonly autocomplete="off" class="layui-input moneyinput disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item height_auto">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label label_textarea">备注</label>
                        <div class="layui-input-block">
                            <textarea id="explain" name="explain" placeholder="请输入" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">关联流程</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="flowrelas" class="layui-input flowrelas" onclick="openPage('../public/choose_flowrelas.php?dom=flowrelas','80%','80%');">
                            <div class="choose_div" id="flowrelas" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_flowrelas.php?dom=flowrelas','80%','80%');"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item layui-hide" id="advanersDiv">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">预审人</label>
                        <div class="layui-input-block relative">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=advaners&type=user&single=2','770px','490px');"></div>
                                <div class="tanxiannei" id="advaners"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=advaners&type=user&single=2','770px','490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item layui-hide" id="nexterDiv">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>指定下一步审核人</label>
                        <div class="layui-input-block relative">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=nexter&type=user&single=1','770px','490px');"></div>
                                <div class="tanxiannei" id="nexter"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=nexter&type=user&single=1','770px','490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <?php include '../public/upinfo.php'?>
        </div>

        <div class="block-generic list_info">
            <div class="layui-form-item height_auto">
                <div class="short_table_list" key="1">
                    <div class="opt-btn-group">
                        <div><span>关联销项发票明细</span></div>
                        <div>
                            <button type="button" onclick="choose_piao_kai_list_page_gonghui()" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn">从开票明细选择</button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn short_table_del_row">删除行</button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn short_table_del_all">删除全部</button>
                        </div>
                    </div>
                    <table class="layui-table" lay-size="sm">
                        <thead>
                        <tr>
                            <th width="45">序号</th>
                            <th>发票号码</th>
                            <th>购买方</th>
                            <th>发票类型</th>
                            <th>价税合计(元)</th>
                            <th>已回款金额(元)</th>
                            <th>待回款金额(元)</th>
                            <th><text>*</text>本次回款占用开票金额(元)</th>
                        </tr>
                        </thead>
                        <tbody class="short_table_tbody" id="list_list"></tbody>
                    </table>
                    <div class="listerror">提示：<span></span></div>
                </div>
            </div>
        </div>

        <div class="block-generic">
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>收取信息</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>本次回款是否收取</label>
                        <div class="layui-input-block">
                            <select id="iskou" name="iskou" lay-filter="iskou">
                                <option value="">请选择</option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                            <p class="error" id="iskou_error" style="margin: 0;"></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<script>
    var param_enginid = getQueryVariable('enginid') || 0;

    $("#commentForm").validate({
        rules: {
            zhai: {required: true},
            money: {required: true},
            dt: {required: true},
        },
        messages:{
            zhai: {required: "请输入"},
            money: {required: "请输入"},
            dt: {required: "请选择"},
        }
    });


    function choose_piao_kai_list_page_gonghui(){
        var enginid = get_choose_val('enginid');
        if(!enginid){
            facade.error("请先选择工程名称");return false;
        }
        openPage('../public/choose_piao_kai_list_page_gonghui.php?page=hou_gonghui&choose_type=checkbox&enginid='+enginid,'80%','80%');
    }

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        render_input_attr();

        facade.ajax({type: 'get', url: ask_flowdata_add_hou_gonghui, data:{enginid:param_enginid}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data;
                $("#flowsetname").text(data.flowsetname);
                $("#flowuser").val(data.flowuser);
                $("#flowdept").val(data.flowdept);
                if(data.isadvan){
                    $("#advanersDiv").removeClass('layui-hide');
                }
                if(data.isnext){
                    $("#nexterDiv").removeClass('layui-hide');
                }


                var engininfo = res.data.engininfo;
                if(engininfo){
                    set_choose_btn('enginid',engininfo.id,engininfo.name);
                    $('#engin_number').val(engininfo.number);
                    $('#engin_gui_unit_name').val(engininfo.gui_unit_name);
                    $('#engin_gofuer').val(engininfo.gofuer);
                    $('#engin_gofutel').val(engininfo.gofutel);
                    if(engininfo.neiinfo){
                        $('#engin_neiname').val(engininfo.neiinfo.name);
                    }
                    if(engininfo.shiinfo){
                        $('#engin_shimoney').val(engininfo.shiinfo.money);
                    }
                    $('#engin_shijiefee').val(engininfo.shijiefee);

                    $('#engin_piaokaifee').val(engininfo.piaokaifee);
                    $('#engin_leixiaobi').val(engininfo.leixiaobi);


                    $('#engin_hougonghuimoney').val(engininfo.hougonghuimoney);
                    $('#engin_leihuibi').val(engininfo.leihuibi);
                    $('#engin_hougongzhimoneyquben').val(engininfo.hougongzhimoneyquben);
                    $('#engin_hougonghuikoufee').val(engininfo.hougonghuikoufee);
                    $('#engin_jiedongkoufee').val(engininfo.jiedongkoufee);
                    $('#engin_gonghui_keyu').val(engininfo.gonghui_keyu);
                }











                xmselect_dan('shougonglei', res.data.shougonglei, '', function (res) {
                    if(res.arr && res.arr.length > 0){
                        $("#shougonglei").find('xm-select').removeClass('error');
                    }else{
                        $("#shougonglei").find('xm-select').addClass('error');
                    }
                });

                xmselect_dan('incdaotype', res.data.incdaotype, '', function (res) {
                    if(res.arr && res.arr.length > 0){
                        $("#incdaotype").find('xm-select').removeClass('error');
                    }else{
                        $("#incdaotype").find('xm-select').addClass('error');
                    }
                });



                short_table_opt_func('', 1);

                public_upload_file_load('upload_files', res.data.files);
                render_date();
                render_from();
                initParseMoney();
            }
        });

        form.on('select(iskou)', function(data){
            if(data.value == ''){
                $('#iskou_error').show().text('请选择');
                $('#iskou_error').parent().find('input').addClass('select_error');
            }else{
                $('#iskou_error').hide();
                $('#iskou_error').parent().find('input').removeClass('select_error');
            }
        });


        form.on('submit(add)', function(data){
            data.field.isturn = $(this).attr('key') || 0;
            data.field.flowrelas = get_choose_val('flowrelas');
            data.field.advaners = tan_tags_getvalue("#advaners", 'user');
            data.field.nexter = tan_tags_getvalue("#nexter", 'user');


            data.field.enginid = get_choose_val('enginid');
            data.field.accid = get_choose_val('accid');
            data.field.duier = get_choose_val('duier');

            if(data.field.isturn > 0){
                var validRes = $("#commentForm").valid();

                formValid('enginid');
                if(data.field.enginid == undefined || !data.field.enginid){
                    validRes = false;
                }


                formValid('duier');
                if(data.field.duier == undefined || !data.field.duier){
                    validRes = false;
                }

                if(!data.field.shougonglei){
                    $("#shougonglei").find('xm-select').addClass('error');
                    validRes = false;
                }else{
                    $("#shougonglei").find('xm-select').removeClass('error');
                }

                if(!data.field.incdaotype){
                    $("#incdaotype").find('xm-select').addClass('error');
                    validRes = false;
                }else{
                    $("#incdaotype").find('xm-select').removeClass('error');
                }

                formValid('accid');
                if(data.field.accid == undefined || !data.field.accid){
                    validRes = false;
                }

                if(data.field.iskou == ''){
                    $('#iskou_error').show().text('请选择');
                    $('#iskou_error').parent().find('input').addClass('select_error');
                    validRes = false;
                }else{
                    $('#iskou_error').hide();
                    $('#iskou_error').parent().find('input').removeClass('select_error');
                }

                if(!validRes){return false;}
            }


            var list = [''];
            try {
                $('#list_list tr').each(function (i) {
                    var piaoid = $(this).find('.nums').attr('piaoid');
                    var daihuikuan = $(this).find('.daihuikuan').val();
                    var xiaofee = $(this).find('.xiaofee').val();

                    var index = i + 1;
                    if(data.field.isturn > 0){
                        if(!xiaofee){
                            throw new Error('第'+index+'行，请选择本次回款占用开票金额');
                        }
                        if(parseFloat(xiaofee) > parseFloat(daihuikuan)){
                            throw new Error('第'+index+'行，本次回款占用开票金额已超过待回款金额');
                        }
                    }

                    list.push({
                        piaoid:piaoid,
                        xiaofee:xiaofee,
                    });
                });
            } catch(e) {
                $(".list_info .listerror").find('span').text(e.message);
                $(".list_info .listerror").show();
                return false;
            }
            $(".list_info .listerror").hide();
            data.field.list = list;



            data.field.files = public_upload_file_value('upload_files');
            data = parseMoney(data);
            public_flow_submit(data.field, ask_flowdata_add_hou_gonghui, ask_flowdata_edit_hou_gonghui, $(this).attr('but'));

            return false;
        });

    });




    $("#money").on('input propertychange',function () {
        jisuan_leimoney();
    });
    function jisuan_leimoney(){
        var engin_hougonghuimoney = parseValidNum(parseFloat($("#engin_hougonghuimoney").val() || 0) || 0);
        var money = parseValidNum($("#money").val());

        var leimoney = parseFloat(engin_hougonghuimoney) + parseFloat(money);

        //算法=累计工程回款含本次÷（施工合同结算金额＞施工合同金额＞中标价）X100
        var engin_shijiefee = parseValidNum(parseFloat($("#engin_shijiefee").val() || 0) || 0);
        var leizhanbi = 0;
        if(engin_shijiefee > 0){
            leizhanbi = parseFloat(leimoney / engin_shijiefee * 100);
        }else{
            var engin_shimoney = parseValidNum(parseFloat($("#engin_shimoney").val() || 0) || 0);
            if(engin_shimoney > 0){
                leizhanbi = parseFloat(leimoney / engin_shimoney * 100);
            }
        }

        $("#leimoney").val(parseFormatNum(leimoney,2));
        $("#leizhanbi").val(parseFormatNum(leizhanbi,2));
    }


    $('#list_list').on('input propertychange','.xiaofee',function () {
        jisuan_xiaofee_all();
    });

    function jisuan_xiaofee_all() {
        var allxiaofee = 0;
        $('#list_list tr').each(function (i) {
            var xiaofee = parseValidNum($(this).find('.xiaofee').val());
            allxiaofee = parseFloat(allxiaofee) + parseFloat(xiaofee);
        });
        $("#xiaofee").val(parseFormatNum(allxiaofee,2));
    }



    function update_refresh_row_func() {
        render_date();
        render_from();
        jisuan_xiaofee_all();
        $.each($("#list_list").children('tr'),function (key,val) {
            $(this).children('td:first-child').html(key+1);
        });
        setTimeout(function () {
            $(".short_table_list table tbody tr").click(function () {
                $(".short_table_list table tbody tr").removeClass('line-row');
                $(".short_table_list table tbody tr").attr('sle','');
                $(this).addClass('line-row');
                $(this).attr('sle','sle');
            });
        },1000);
    }



    function go_to_engin_xiang(){
        var enginid = get_choose_val('enginid');
        if(!enginid){
            facade.error("请先选择工程名称");return false;
        }
        openPage('../engin/xiang.php?id='+enginid);
    }
</script>
</body>
</html>
